using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
namespace 纺织贸易管理系统
{
    public static class danjumingxitableService
    {
        public static List<danjumingxitable> Getdanjumingxitablelst(string sql)
        {
            return Connect.dbcontext.Ado.SqlQuery<danjumingxitable>(sql);
        }
        public static List<danjumingxitable> Getdanjumingxitablelst(Expression<Func<danjumingxitable ,bool >> func)
         {
            return  Connect.dbcontext.Queryable<danjumingxitable>().Where(func).ToList ();
         }
        public static danjumingxitable GetOnedanjumingxitable(Expression<Func<danjumingxitable, bool>> func)
         {
            return  Connect.CreatConnect().QueryOneResult<danjumingxitable>(func);
         }
        public static void Insertdanjumingxitablelst(List<danjumingxitable> danjumingxitableObjs)
         {
            Connect.dbcontext.Insertable<danjumingxitable>(danjumingxitableObjs).ExecuteCommand();
        }
        public static void Insertdanjumingxitable(danjumingxitable danjumingxitableObj)
         {
              Connect.dbcontext.Insertable<danjumingxitable>(danjumingxitableObj).ExecuteCommand();
         }
        public static void Updatedanjumingxitable(danjumingxitable danjumingxitableObj)
         {
              Connect.dbcontext.Updateable(danjumingxitableObj).ExecuteCommand();
         }
        public static void Updatedanjumingxitable(List<danjumingxitable>objs)
        {
           Connect.dbcontext.Updateable(objs).ExecuteCommand();
        }
        public static void Deletedanjumingxitable(Expression<Func<danjumingxitable, bool>> func)
         {
            Connect.dbcontext.Deleteable<danjumingxitable>().Where(func).ExecuteCommand();
         }
        public static List<danjumingxitable> GetNotNull(List<danjumingxitable> details)
        {
            return details.Where(x=>!string.IsNullOrEmpty(x.pingming)).ToList ();
        }
    }
}
